package com.sicheng.lc.周赛.分类.哈西表or计数or滑动窗口or双指针;

/**
 * @author zsc
 * @version 1.0
 * @date 2022/6/20 22:36
 */
public class 收件节节高 {
    //https://leetcode.cn/contest/sf-tech/problems/8oimK4/
    public int findMaxCI(int[] nums) {
        if (nums.length <= 1) {
            return nums.length;
        }

        int last = 0;
        int res = -1;
        for (int i = 1; i < nums.length; i++) {
            while (i < nums.length && nums[i] > nums[i - 1]) {
                i++;
            }
            res = Math.max(i - last, res);
            last = i;
        }
        if (last < nums.length) {
            res = Math.max(res, nums.length - last);
        }
        return res;

    }
}
